import "./App.css";
import React from "react";
import { Route, Redirect } from "react-router-dom";
import List from "./pages/ProductList";
import Categories from "./pages/product_categories";
import Login from "./pages/Login";
/* 
import User from "./pages/User";  */
import Main from "./Main";
function App() {
  return (
    <div className="App">
      {/* 
      <NavLink activeClassName="active" to="/user">
        用户
      </NavLink>
      <NavLink activeClassName="active" to="/login">
        登录
      </NavLink> */}

      <hr />
      <Route path="/login" component={Login}></Route>
      <Route path="/admin">
        <Main>
          <Route path="/admin/categories" component={Categories}></Route>
          <Route path="/admin/list" exact component={List}></Route>
        </Main>
      </Route>
      <Redirect to="/login" from="/"></Redirect>
      {/* 
      
      <Route path="/user" component={User}></Route>
      <Route path="/login" component={Login}></Route> */}
    </div>
  );
}

export default App;
